/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package gwtroot.My;

import com.google.gwt.user.client.rpc.IsSerializable;

import org.eclipse.emf.common.util.Reflect;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * The <b>Package</b> for the model.
 * It contains accessors for the meta objects to represent
 * <ul>
 *   <li>each class,</li>
 *   <li>each feature of each class,</li>
 *   <li>each enum,</li>
 *   <li>and each data type</li>
 * </ul>
 * <!-- end-user-doc -->
 * @see gwtroot.My.MyFactory
 * @model kind="package"
 * @generated
 */
public class MyPackage extends EPackageImpl {
	/**
	 * The package name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final String eNAME = "My";

	/**
	 * The package namespace URI.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final String eNS_URI = "My";

	/**
	 * The package namespace name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final String eNS_PREFIX = "My";

	/**
	 * The singleton instance of the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final MyPackage eINSTANCE = gwtroot.My.MyPackage.init();

	/**
	 * The meta object id for the '{@link gwtroot.My.Vehicle <em>Vehicle</em>}' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see gwtroot.My.Vehicle
	 * @see gwtroot.My.MyPackage#getVehicle()
	 * @generated
	 */
	public static final int VEHICLE = 0;

	/**
	 * The feature id for the '<em><b>Wheels</b></em>' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int VEHICLE__WHEELS = 0;

	/**
	 * The feature id for the '<em><b>Version</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int VEHICLE__VERSION = 1;

	/**
	 * The feature id for the '<em><b>Id</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int VEHICLE__ID = 2;

	/**
	 * The number of structural features of the '<em>Vehicle</em>' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int VEHICLE_FEATURE_COUNT = 3;

	/**
	 * The meta object id for the '{@link gwtroot.My.Car <em>Car</em>}' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see gwtroot.My.Car
	 * @see gwtroot.My.MyPackage#getCar()
	 * @generated
	 */
	public static final int CAR = 1;

	/**
	 * The feature id for the '<em><b>Wheels</b></em>' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int CAR__WHEELS = VEHICLE__WHEELS;

	/**
	 * The feature id for the '<em><b>Version</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int CAR__VERSION = VEHICLE__VERSION;

	/**
	 * The feature id for the '<em><b>Id</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int CAR__ID = VEHICLE__ID;

	/**
	 * The number of structural features of the '<em>Car</em>' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int CAR_FEATURE_COUNT = VEHICLE_FEATURE_COUNT + 0;

	/**
	 * The meta object id for the '{@link gwtroot.My.Aircraft <em>Aircraft</em>}' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see gwtroot.My.Aircraft
	 * @see gwtroot.My.MyPackage#getAircraft()
	 * @generated
	 */
	public static final int AIRCRAFT = 2;

	/**
	 * The feature id for the '<em><b>Wheels</b></em>' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int AIRCRAFT__WHEELS = VEHICLE__WHEELS;

	/**
	 * The feature id for the '<em><b>Version</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int AIRCRAFT__VERSION = VEHICLE__VERSION;

	/**
	 * The feature id for the '<em><b>Id</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int AIRCRAFT__ID = VEHICLE__ID;

	/**
	 * The number of structural features of the '<em>Aircraft</em>' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int AIRCRAFT_FEATURE_COUNT = VEHICLE_FEATURE_COUNT + 0;

	/**
	 * The meta object id for the '{@link gwtroot.My.Wheel <em>Wheel</em>}' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see gwtroot.My.Wheel
	 * @see gwtroot.My.MyPackage#getWheel()
	 * @generated
	 */
	public static final int WHEEL = 3;

	/**
	 * The feature id for the '<em><b>Version</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int WHEEL__VERSION = 0;

	/**
	 * The feature id for the '<em><b>Id</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int WHEEL__ID = 1;

	/**
	 * The number of structural features of the '<em>Wheel</em>' class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	public static final int WHEEL_FEATURE_COUNT = 2;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass vehicleEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass carEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass aircraftEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass wheelEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see gwtroot.My.MyPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private MyPackage() {
		super(eNS_URI, MyFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link MyPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static MyPackage init() {
		if (isInited)
			return (MyPackage) EPackage.Registry.INSTANCE
					.getEPackage(MyPackage.eNS_URI);

		initializeRegistryHelpers();

		// Obtain or create and register package
		MyPackage theMyPackage = (MyPackage) (EPackage.Registry.INSTANCE
				.get(eNS_URI) instanceof MyPackage ? EPackage.Registry.INSTANCE
				.get(eNS_URI) : new MyPackage());

		isInited = true;

		// Create package meta-data objects
		theMyPackage.createPackageContents();

		// Initialize created meta-data
		theMyPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theMyPackage.freeze();

		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(MyPackage.eNS_URI, theMyPackage);
		return theMyPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static void initializeRegistryHelpers() {
		Reflect.register(Vehicle.class, new Reflect.Helper() {
			public boolean isInstance(Object instance) {
				return instance instanceof Vehicle;
			}

			public Object newArrayInstance(int size) {
				return new Vehicle[size];
			}
		});
		Reflect.register(Car.class, new Reflect.Helper() {
			public boolean isInstance(Object instance) {
				return instance instanceof Car;
			}

			public Object newArrayInstance(int size) {
				return new Car[size];
			}
		});
		Reflect.register(Aircraft.class, new Reflect.Helper() {
			public boolean isInstance(Object instance) {
				return instance instanceof Aircraft;
			}

			public Object newArrayInstance(int size) {
				return new Aircraft[size];
			}
		});
		Reflect.register(Wheel.class, new Reflect.Helper() {
			public boolean isInstance(Object instance) {
				return instance instanceof Wheel;
			}

			public Object newArrayInstance(int size) {
				return new Wheel[size];
			}
		});
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static class WhiteList implements IsSerializable, EBasicWhiteList {
		/**
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		protected Vehicle vehicle;

		/**
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		protected Car car;

		/**
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		protected Aircraft aircraft;

		/**
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		protected Wheel wheel;

	}

	/**
	 * Returns the meta object for class '{@link gwtroot.My.Vehicle <em>Vehicle</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for class '<em>Vehicle</em>'.
	 * @see gwtroot.My.Vehicle
	 * @generated
	 */
	public EClass getVehicle() {
		return vehicleEClass;
	}

	/**
	 * Returns the meta object for the containment reference list '{@link gwtroot.My.Vehicle#getWheels <em>Wheels</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for the containment reference list '<em>Wheels</em>'.
	 * @see gwtroot.My.Vehicle#getWheels()
	 * @see #getVehicle()
	 * @generated
	 */
	public EReference getVehicle_Wheels() {
		return (EReference) vehicleEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * Returns the meta object for the attribute '{@link gwtroot.My.Vehicle#getVersion <em>Version</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for the attribute '<em>Version</em>'.
	 * @see gwtroot.My.Vehicle#getVersion()
	 * @see #getVehicle()
	 * @generated
	 */
	public EAttribute getVehicle_Version() {
		return (EAttribute) vehicleEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * Returns the meta object for the attribute '{@link gwtroot.My.Vehicle#getId <em>Id</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for the attribute '<em>Id</em>'.
	 * @see gwtroot.My.Vehicle#getId()
	 * @see #getVehicle()
	 * @generated
	 */
	public EAttribute getVehicle_Id() {
		return (EAttribute) vehicleEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * Returns the meta object for class '{@link gwtroot.My.Car <em>Car</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for class '<em>Car</em>'.
	 * @see gwtroot.My.Car
	 * @generated
	 */
	public EClass getCar() {
		return carEClass;
	}

	/**
	 * Returns the meta object for class '{@link gwtroot.My.Aircraft <em>Aircraft</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for class '<em>Aircraft</em>'.
	 * @see gwtroot.My.Aircraft
	 * @generated
	 */
	public EClass getAircraft() {
		return aircraftEClass;
	}

	/**
	 * Returns the meta object for class '{@link gwtroot.My.Wheel <em>Wheel</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for class '<em>Wheel</em>'.
	 * @see gwtroot.My.Wheel
	 * @generated
	 */
	public EClass getWheel() {
		return wheelEClass;
	}

	/**
	 * Returns the meta object for the attribute '{@link gwtroot.My.Wheel#getVersion <em>Version</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for the attribute '<em>Version</em>'.
	 * @see gwtroot.My.Wheel#getVersion()
	 * @see #getWheel()
	 * @generated
	 */
	public EAttribute getWheel_Version() {
		return (EAttribute) wheelEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * Returns the meta object for the attribute '{@link gwtroot.My.Wheel#getId <em>Id</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the meta object for the attribute '<em>Id</em>'.
	 * @see gwtroot.My.Wheel#getId()
	 * @see #getWheel()
	 * @generated
	 */
	public EAttribute getWheel_Id() {
		return (EAttribute) wheelEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * Returns the factory that creates the instances of the model.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the factory that creates the instances of the model.
	 * @generated
	 */
	public MyFactory getMyFactory() {
		return (MyFactory) getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated)
			return;
		isCreated = true;

		// Create classes and their features
		vehicleEClass = createEClass(VEHICLE);
		createEReference(vehicleEClass, VEHICLE__WHEELS);
		createEAttribute(vehicleEClass, VEHICLE__VERSION);
		createEAttribute(vehicleEClass, VEHICLE__ID);

		carEClass = createEClass(CAR);

		aircraftEClass = createEClass(AIRCRAFT);

		wheelEClass = createEClass(WHEEL);
		createEAttribute(wheelEClass, WHEEL__VERSION);
		createEAttribute(wheelEClass, WHEEL__ID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized)
			return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		carEClass.getESuperTypes().add(this.getVehicle());
		aircraftEClass.getESuperTypes().add(this.getVehicle());

		// Initialize classes and features; add operations and parameters
		initEClass(vehicleEClass, Vehicle.class, "Vehicle", IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getVehicle_Wheels(), this.getVehicle(), null, "wheels",
				null, 0, -1, Vehicle.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getVehicle_Version(), ecorePackage.getELongObject(),
				"version", null, 1, 1, Vehicle.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEAttribute(getVehicle_Id(), ecorePackage.getELongObject(), "id",
				null, 0, 1, Vehicle.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				IS_ORDERED);

		initEClass(carEClass, Car.class, "Car", !IS_ABSTRACT, !IS_INTERFACE,
				IS_GENERATED_INSTANCE_CLASS);

		initEClass(aircraftEClass, Aircraft.class, "Aircraft", !IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(wheelEClass, Wheel.class, "Wheel", !IS_ABSTRACT,
				!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getWheel_Version(), ecorePackage.getELongObject(),
				"version", null, 1, 1, Wheel.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEAttribute(getWheel_Id(), ecorePackage.getELongObject(), "id",
				null, 0, 1, Wheel.class, !IS_TRANSIENT, !IS_VOLATILE,
				IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
				IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

	/**
	 * <!-- begin-user-doc -->
	 * Defines literals for the meta objects that represent
	 * <ul>
	 *   <li>each class,</li>
	 *   <li>each feature of each class,</li>
	 *   <li>each enum,</li>
	 *   <li>and each data type</li>
	 * </ul>
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public interface Literals {
		/**
		 * The meta object literal for the '{@link gwtroot.My.Vehicle <em>Vehicle</em>}' class.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @see gwtroot.My.Vehicle
		 * @see gwtroot.My.MyPackage#getVehicle()
		 * @generated
		 */
		public static final EClass VEHICLE = eINSTANCE.getVehicle();

		/**
		 * The meta object literal for the '<em><b>Wheels</b></em>' containment reference list feature.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		public static final EReference VEHICLE__WHEELS = eINSTANCE
				.getVehicle_Wheels();

		/**
		 * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		public static final EAttribute VEHICLE__VERSION = eINSTANCE
				.getVehicle_Version();

		/**
		 * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		public static final EAttribute VEHICLE__ID = eINSTANCE.getVehicle_Id();

		/**
		 * The meta object literal for the '{@link gwtroot.My.Car <em>Car</em>}' class.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @see gwtroot.My.Car
		 * @see gwtroot.My.MyPackage#getCar()
		 * @generated
		 */
		public static final EClass CAR = eINSTANCE.getCar();

		/**
		 * The meta object literal for the '{@link gwtroot.My.Aircraft <em>Aircraft</em>}' class.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @see gwtroot.My.Aircraft
		 * @see gwtroot.My.MyPackage#getAircraft()
		 * @generated
		 */
		public static final EClass AIRCRAFT = eINSTANCE.getAircraft();

		/**
		 * The meta object literal for the '{@link gwtroot.My.Wheel <em>Wheel</em>}' class.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @see gwtroot.My.Wheel
		 * @see gwtroot.My.MyPackage#getWheel()
		 * @generated
		 */
		public static final EClass WHEEL = eINSTANCE.getWheel();

		/**
		 * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		public static final EAttribute WHEEL__VERSION = eINSTANCE
				.getWheel_Version();

		/**
		 * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
		 * @generated
		 */
		public static final EAttribute WHEEL__ID = eINSTANCE.getWheel_Id();

	}

} //MyPackage
